<template>
    <div class="box">
        <ul>
            <li v-for="(item,index) in TVB" :key="index" @click="handleJupm(index)">
                <img :src="`https://www.160dyf.com/${item.imagePath}`" alt="">
                <!-- <img :src="item.image" alt=""> -->
                <span>{{item.title}}</span>
            </li>
        </ul>
    </div>
</template>

<script>
    import {homelist} from '../api/home'
    export default {
        data() {
            return {
                TVB: []
            }
        },
        created () {
            homelist().then(res=>{
                // console.log(res.data.data.moduleMap[1].item_data);
                this.TVB = res.data.data.moduleMap[1].item_data
            })
        },
        methods: {
            handleJupm(idx) {
                if(idx==0){
                     this.$router.push("/coupon")
                }
                if(idx==1){
                    this.$router.push({
                        name:"goodlist",
                        params:{
                            num:111
                        }
                    })
                }
                if(idx==2){
                    this.$router.push({
                        name:"goodlist",
                        params:{
                            num:107
                        }
                    })
                }
                if(idx==3){
                    this.$router.push({
                        name:"goodlist",
                        params:{
                            num:96
                        }
                    })
                }
                if(idx==4){
                    this.$router.push({
                        name:"goodlist",
                        params:{
                            num:17
                        }
                    })
                }
                if(idx==5){
                    this.$router.push({
                        name:"goodlist",
                        params:{
                            num:217
                        }
                    })
                }
                if(idx==6){
                    this.$router.push({
                        name:"goodlist",
                        params:{
                            num:216
                        }
                    })
                }
                if(idx==7){
                    this.$router.push({
                        name:"goodlist",
                        params:{
                            num:238
                        }
                    })
                }
                if(idx==8){
                    this.$router.push({
                        name:"goodlist",
                        params:{
                            num:219
                        }
                    })
                }
            }
        },
    }
</script>

<style lang="less" scoped>

ul{
    margin: auto;
    // width: 335px;
    padding: 0 10px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    li{
        height: 78px;
        font-size: 12px;
        color: #222;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-content: center;
        margin: 10px 5px;
        img{
            width: 52px;
            height: 52px;
        }
    }
}

</style>